package com.xin.controller;

import com.github.pagehelper.PageInfo;
import com.xin.model.Vaccination;
import com.xin.service.IUserinfoService;
import com.xin.service.IVaccinationService;
import com.xin.util.JsonObject;
import io.swagger.annotations.Api;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author 夜天
 * @Date 2022/4/20 10:16
 * @Version 1.0.0
 * @description： 疫苗接种
 */
@Api(tags = {""})
@RestController
@RequestMapping("/vaccination")
public class VaccinationController {
    private Logger log = LoggerFactory.getLogger(getClass());

    @Resource
    private IVaccinationService vaccinationService;
    @RequestMapping("/findAllVaccination")
    public JsonObject findAllVaccination(@RequestParam(defaultValue = "1") Integer page,
                                         @RequestParam(defaultValue = "15") Integer limit,
                                         Vaccination vaccination){
        JsonObject object=new JsonObject();
        PageInfo<Vaccination> vaccinationAll = vaccinationService.findVaccinationAll(page, limit, vaccination);
        object.setCode(0);
        object.setMsg("ok");
        object.setCount(vaccinationAll.getTotal());
        object.setData(vaccinationAll.getList());
        return object;
    }
}
